import Vue from 'vue'
import Vuex from 'vuex'
import storePersistedState from 'vuex-persistedstate'
import common from './modules/common'
import user from './modules/user'
import getters from './getters'
Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    common,
    user
  },
  getters,
  plugins: [storePersistedState({
    storage: window.sessionStorage,
    reducer (vuex) {
      return {
        common: {
          theme: vuex.common.theme,
          website: vuex.common.website
        }
      }
    }
  })]
})
